package demo.practice.leetcode;

public class P1712 {

    //确实没做出来
    //https://leetcode-cn.com/problems/binode-lcci/

    public static void main(String[] args) {

        P1712 o = new P1712();
        TreeNode r = new TreeNode(3);
        r.left = new TreeNode(1);
        r.right = new TreeNode(4);
        r.left.right = new TreeNode(2);




    }





    public TreeNode convertBiNode(TreeNode root) {

         if(root==null)
             return null;

         if(root.left!=null){
             convertBiNode(root.left);
         }

         TreeNode tmp= root.right;
         root.right= new TreeNode(root.val);
         root.right.right= tmp;
        convertBiNode(root.right);

        return root;
    }


}

